import axios from "axios";

export const HttpRequest = axios.create({
  baseURL: "http://101.201.116.122:4000",
  setTimeout: 5000,
});

HttpRequest.interceptors.request.use((config) => {
  config.headers["Authorization"] = localStorage.getItem("token") || ""; // 将token设置到请求头中
  return config;
});
//响应拦截器
HttpRequest.interceptors.response.use((response) => {
  return response; // 直接返回响应
});
